package com.axon.lemon

import org.codehaus.groovy.grails.validation.InListConstraint;

class Place {
	double lat
	double lng
	float price
	String address
	String description
	byte[] avatar
	Boolean buyOrRent
	int bed
	int bath
	Boolean status //trang thai hien thi (T/F)
	PropertyType propertytype
	District district
	City city
	Contact contact
	static belongsTo = [userprofile:UserProfile]
	static hasMany = [features:Feature,images:Image]
	
	
	String tostring() {
		propertytype.namePropertyType
	};
	
    static constraints = {
		lat shared: 'share_lat_lng'
		lng shared: 'share_lat_lng'
		bed shared: 'share_bed_bath'
		bath shared: 'share_bed_bath'
    }
	
	static mapping = {
		contact lazy:false
		//avatar size: 1024 * 1024, type: 'blob'
		//columns { avatar type:'blob' }
	}
}